<include file="Public:header" />
<div class="container">
	<div class="page-header">
		<h4>{:L('SHORT_MESSAGE_VIEW')}</h4>
	</div>
	<include file="Public:alert"/>
	<div class="row">
		<div class="tabbable span12">
			<div class="tab-content">
					<table class="table table-hover">
						<thead>
							<tr> 
								<td>&nbsp;</td>
								<td <if condition="C('ismobile') neq 1">colspan="3"</if>><if condition="session('role_id')==$info['to_role_id'] || $info['to_role_id'] = 0" ><a class="btn btn-primary" id="reply" href="javascript:void(0);"/>{:L('REPLY')}</a> </if>&nbsp;
								<a class="btn" id="delete" href="{:U('message/delete', 'id='.$info['message_id'])}"/>{:L('DELETE')}</a> &nbsp;<a class="btn" href="{:U('message/index')}">{:L('RETURN')}</a></td>
							</tr>
						</thead>
						<tbody>
							<tr><th colspan="4">{:L('SHORT_MESSAGE')}</th></tr>
							<tr> 
								<td class="tdleft" width="15%">{:L('THE_SENDERS')}</td>
								<td width="35%"><notempty name="info.from_role_id">{$info.from_name}<else />{:L('SYSTEM_ADMINISTRATOR')}</notempty></td>
								<if condition="C('ismobile') eq 1"></tr><tr></if>
								<td class="tdleft" width="15%">{:L('SEND_TIMES')}</td>
								<td width="35%">{$info.send_time|date='Y-m-d H:i:s',###}</td>
							</tr>
							<tr>
								<td class="tdleft" width="15%">{:L('CONTENTSS')}</td>
								<td <if condition="C('ismobile') neq 1">colspan="3"</if>><pre>{$info.content}</pre></td>
							</tr>
							<tr>
								<td <if condition="C('ismobile') eq 1">colspan="2"<else />colspan="4"</if>></td>
							</tr>
						</tbody>
					</table>
			</div>
		</div>
	</div>
</div>
<div class="hide" id="dialog-send" title="{:L('WRITE_LETTER')}">loading...</div>

<script type="text/javascript">
<if condition="C('ismobile') eq 1">width=$('.container').width() * 0.9;<else/>width=800;</if> 
$("#dialog-send").dialog({
    autoOpen: false,
    modal: true,
	width: width,
	maxHeight: 400,
	position: ["center",100]
});
$(function(){
	$("#reply").click(function(){
		$('#dialog-send').dialog('open');
		$('#dialog-send').load('{:U("message/send")}&from_role_id='+{$info.from_role_id});
	});
	$("#delete").click(function(){
	if(!confirm("{:L('ARE_YOU_SRUE_DELETE')}")){
		return false;
	}
})
});
</script>
<include file="Public:footer" />	